package com.googlecode.lightest.studio

import com.googlecode.lightest.core.filter.ParserFactory

/**
 * A test filter represents a search across tests by metadata.
 */
class TestFilter {
    String filterString
    
    static belongsTo = TestSuite
    
    static constraints = {
        filterString (blank: false, validator: {
            def parser = new ParserFactory().createParser(it)
            def result = parser.expr()
            
            return result.filter != null
        })
    }
    
    String toString() {
        return filterString
    }
}
